Report coverage to Coveralls on pull requests using GITHUB_TOKEN - #109
Merged
Conversation
The Coverage workflow only triggered on: [push] and used coveralls_reborn with a COVERALLS_REPO_TOKEN secret, so it never ran on pull requests, and PRs from forks wouldn't have access to that secret anyway, meaning coverage was never reported to Coveralls or shown as a PR check. Reporting from a single dedicated Ruby version also undercounts real coverage relative to the full test matrix. - Switch from coveralls_reborn to the official coverallsapp/github-action, authenticated with the default GITHUB_TOKEN (available on every workflow run, including from fork PRs, no extra secret to configure). - Switch the SimpleCov formatter from coveralls_reborn's to simplecov-lcov, since coverallsapp/github-action consumes an lcov report. - Report coverage from every job in the test matrix (one per Ruby/JRuby version) as a parallel Coveralls build, and add a coverage-finished job that closes the parallel build after all test jobs complete, so Coveralls merges the per-job lcov reports into a single aggregate coverage number. - Remove the now-redundant single-Ruby coverage.yml workflow, folding reporting into test.yml (which already triggers on pull_request). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Danger ReportNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Coverage workflow only triggers
on: [push]and usescoveralls_rebornwith aCOVERALLS_REPO_TOKENsecret. This means it never runs on pull requests, and even if it did, PRs from forks don't have access to that secret, so coverage is never reported to Coveralls or shown as a PR check. Reporting from a single dedicated Ruby version also undercounts real coverage relative to the full test matrix.coveralls_rebornto the officialcoverallsapp/github-action, authenticated with the defaultGITHUB_TOKEN(available on every workflow run, including from fork PRs — no extra secret to configure).coveralls_reborn's tosimplecov-lcov, sincecoverallsapp/github-actionconsumes an lcov report.coverage-finishedjob that closes the parallel build after all test jobs complete, so Coveralls merges the per-job lcov reports into a single aggregate coverage number.coverage.ymlworkflow, folding reporting intotest.yml(which already triggers onpull_request).Once this merges, the
COVERALLS_REPO_TOKENrepo secret can be removed since it's no longer used.Verified locally:
bundle exec rubocopreports no offenses; 345 examples, 0 failures, 100% line coverage with an lcov report generated.